﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ZYHand.IOC
{
    public class Operation :IOperation 
    {
        private IPlayer mediaPlayer;
        private IMediaFile mediaFile;
        public  Operation(IPlayer _mediaPlayer, IMediaFile _mediaFile)
        {
            mediaPlayer = _mediaPlayer;
            mediaFile = _mediaFile;
        }
        public void PlayMain() 
        {
            mediaFile.FilePath = "/Path/File.mp3";
            mediaPlayer.Play(mediaFile);
        }

        public T Pause<T>() where T : class, new()
        {
            //对象转T类型，需要先转成object类型
            return (T)(Object)new MediaFile {FilePath="fsjkl"};
        
        }


    }
}
